INCLUDE_DIRECTORIES( ${SDL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} )

SET(COMMON_FILES COCOA SDLVideo.cpp SDLSurfaceSprite2D.cpp GamepadControl.cpp)
IF(VITA)
	SET(COMMON_FILES ${COMMON_FILES} DPadSoftKeyboard.cpp)
ENDIF()
IF(SDL_BACKEND STREQUAL "SDL2")
	IF(USE_OPENGL)
		ADD_GEMRB_PLUGIN( SDLVideo ${COMMON_FILES} SDL20Video.cpp SDL20GLVideo.cpp GLSLProgram.cpp Matrix.cpp GLTextureSprite2D.cpp GLPaletteManager.cpp)
		TARGET_LINK_LIBRARIES( SDLVideo ${SDL_LIBRARY} ${OPENGL_LIBRARY} ${GLEW_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${COCOA_LIBRARY_PATH})
		IF(MINGW)
			TARGET_LINK_LIBRARIES( SDLVideo imm32 winmm version)
		ENDIF()

		# Shaders are installed in gemrb/CMakeLists.txt for better mac compatibility
		# also copy to the build dir for no-install runs
		FILE(COPY Shaders DESTINATION ${CMAKE_BINARY_DIR})
	ELSE()
		ADD_GEMRB_PLUGIN( SDLVideo ${COMMON_FILES} SDL20Video.cpp)
		TARGET_LINK_LIBRARIES( SDLVideo ${SDL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${COCOA_LIBRARY_PATH})
	ENDIF()
ELSE()
	ADD_GEMRB_PLUGIN (SDLVideo ${COMMON_FILES} SDL12Video.cpp)
	TARGET_LINK_LIBRARIES( SDLVideo ${SDL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${COCOA_LIBRARY_PATH})
ENDIF()
